---@class Table_SoundTempItem
local Table_SoundTempItem = BaseClass("Table_SoundTempItem", IDataItem)

function Table_SoundTempItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type string @文件名称
	self.ResName = ""
	---@type number @音量
	self.Volume = 0
	---@type boolean @是否循环
	self.IsLoop = false
	---@type number @音效类型
	self.SoundType = 0
	---@type number @播放类型
	self.PlayType = 0
	---@type number @最大音量
	self.MinDis = 0
	---@type number @最小音量
	self.MaxDis = 0
	---@type number[] @音效点坐标
	self.Pos = {}
end

function Table_SoundTempItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.ResName = reader:ReadString()
	self.temp = reader:ReadShortString()
	self.Volume = tonumber(self.temp)
	self.IsLoop = reader:ReadBool()
	self.temp = reader:ReadShortString()
	self.SoundType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.PlayType = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.MinDis = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.MaxDis = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Pos = Utility.StringToNumbers(self.temp)
end

---@class Table_SoundTempMgr : IDataMgr
local this = BaseClass("Table_SoundTempMgr", IDataMgr)

function this:FileName()
	return "Txt/SoundTemp.txt"
end

---@return Table_SoundTempItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_SoundTempItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_SoundTempItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_SoundTempMgr
Table_SoundTempMgr = this()